<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        img {
            width: 200px;
            height: 200px;
        }
    </style>
    <script src="../js/jquery-3.6.0.min.js"></script>
    <script>

        let names = ["kj.png","rc.png","x.png","z1.gif"]
        let timer

        function startC() {
            clearInterval(timer)
            timer = setInterval(change,80)
        }

        function change() {
            let name = names[Math.floor(Math.random()*names.length)];
            $("#stuImg").prop("src","../1.2.3img/"+name)
            $("#stuName").text(name)
        }

        function stopC() {
            clearInterval(timer)
        }

    </script>
</head>
<body>
<button onclick="startC()">开始</button>
<button onclick="stopC()">停止</button>
<hr>
<img src="../1.2.3img/kj.png" id="stuImg" alt="">
<p id="stuName"></p>

</body>
</html>